﻿// -------------------------------------------------------------------------
//    @FileName         :    NFMMOWorldPlayerPlugin.cpp
//    @Author           :    gaoyi
//    @Date             :    2025-02-27
//    @Email			:    445267987@qq.com
//    @Module           :    NFMMOWorldPlayerPlugin
//
// -------------------------------------------------------------------------

#include "NFMMOWorldPlayerPlugin.h"

#include "NFWorldData.h"
#include "NFComm/NFPluginModule/NFIPluginManager.h"
#include "NFWorldPlayerModule.h"
#include "NFWorldWelfareDBData.h"
#include "NFLogicCommon/NFWelfareConf.h"
#include "Welfare/NFWorldWelfareMgr.h"

#ifdef NF_DYNAMIC_PLUGIN

NF_EXPORT void DllStartPlugin(NFIPluginManager* pm)
{
    CREATE_PLUGIN(pm, NFMMOWorldPlayerPlugin)

};

NF_EXPORT void DllStopPlugin(NFIPluginManager* pm)
{
    DESTROY_PLUGIN(pm, NFMMOWorldPlayerPlugin)
};

#endif


//////////////////////////////////////////////////////////////////////////

int NFMMOWorldPlayerPlugin::GetPluginVersion()
{
    return 0;
}

std::string NFMMOWorldPlayerPlugin::GetPluginName()
{
    return GET_CLASS_NAME(NFMMOWorldPlayerPlugin);
}

void NFMMOWorldPlayerPlugin::Install()
{
    REGISTER_MODULE(m_pObjPluginManager, NFWorldPlayerModule, NFWorldPlayerModule);
}

void NFMMOWorldPlayerPlugin::Uninstall()
{
    UNREGISTER_MODULE(m_pObjPluginManager, NFWorldPlayerModule, NFWorldPlayerModule);
}

bool NFMMOWorldPlayerPlugin::InitShmObjectRegister()
{
    /////////////////////mgr//////////////////////
    REGISTER_SINGLETON_SHM_OBJ(NFWorldWelfareMgr);
    /////////////////////mgr//////////////////////
    REGISTER_SHM_OBJ_WITH_HASH(NFWorldData, 0);
    REGISTER_SINGLETON_SHM_OBJ(NFWorldWelfareDBData);

    return true;
}